package com.gjh.study.basic.thread;

import java.util.concurrent.FutureTask;

/**
 * @author guangjh
 * @version 1.0
 * @date 2020/7/20 8:01
 */
public class MyCallable {
    public static void main(String[] args) {
        FutureTask<Integer> task = new FutureTask<Integer>(new CallableImpl());
        Thread thread = new Thread(task);
        thread.start();
        try {
            System.out.println("task.get() returns " + task.get());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
